{% extends "youpu_base.html" %}
{% load static crispy_forms_tags thumbnail %}

{% block title %}用户信息 - {{ block.super }}{% endblock %}

{% block css %}
    <link href="{% static 'css/user_form.css' %}" rel="stylesheet">
{% endblock css %}

{% block content %}

    <div class="row profile">
        <div class="col-md-3">
            <h2>{{ user.username }}</h2>
            {% if user.picture %}
                <img src="{{ user.picture.url }}" height="180px" alt="用户头像"  id="pic" class="img-circle">
            {% else %}
                <img src="{% static 'img/user.png' %}" height="180px" alt="没有头像" class="img-circle"/>
            {% endif %}

        </div>

        <div class="col-md-9">
            <form enctype="multipart/form-data" class="form-horizontal" method="post"
                  action="{% url 'youpu:users_update' %}">
                {% csrf_token %}
                {{ form|crispy }}
                <div class="control-group">
                    <div class="controls">
                        <button type="submit" class="btn btn-primary">更新</button>
                    </div>
                </div>
            </form>
        </div>
    </div>

{% endblock %}
